<?php
require_once("./DButil.php");
$username=$_REQUEST['username'];
$password=$_REQUEST['password'];
$usecode=$_REQUEST['usecode'];

if(!$_SESSION['code'] || $_SESSION['code']!=$usecode){
    echo "<h2 style='color:red'>验证码输入有误，请重新输入</h2>" ;
    return;
}
$resultArr=query(getConn(),"select * from t_sys_user where su_name='$username' and su_pwd='$password'");
$usersArr=$resultArr['data'];
if(!$usersArr){
    echo"<h2 style='color:red'>用户名密码输入错误，请重新输入</h2>";
    return;
}
$loginUser=$usersArr[0];
$_SESSION['loginUser']=$loginUser;
print_r($loginUser);
header("location:selectProducts.php");
?>